const exp =require('express')
const ejs=require('ejs')

const session = require('express-session')

const loginRouter=require('./routes/loginRouter')
const pageRouter=require('./routes/pageRouter')
const apiRouter=require('./routes/apiRouter')




let app = exp()
app.engine('html',ejs.renderFile)
app.use(exp.urlencoded({extended:false}))
app.use(session({
  name:"s_id",
  secret:"CD0417",
  saveUninitialized:true,
  resave:true,
  cookie:{
    httpOnly:true,
    maxAge:1000*60*60
  }
}))





app.use(loginRouter)
app.use(pageRouter)
app.use(apiRouter)





app.listen(80,()=>{
  console.log('启动成功');
})